home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-base.lha / gnu / etc / ksh.kshrc next >
Text File  |  1994-07-25  |  2KB  |  94 lines

  1. :
  2. # NAME:
  3. #    ksh.kshrc - global initialization for ksh 
  4. #
  5. # DESCRIPTION:
  6. #    Each invocation of /bin/ksh processes the file pointed
  7. #    to by $ENV (usually $HOME/.kshrc).
  8. #    This file is intended as a global .kshrc file for the
  9. #    Korn shell.  A user's $HOME/.kshrc file simply requires
  10. #    the line:
  11. #        . /etc/ksh.kshrc
  12. #    at or near the start to pick up the defaults in this
  13. #    file which can then be overridden as desired.
  14. #
  15. # SEE ALSO:
  16. #    $HOME/.kshrc
  17. #
  18. # RCSid:
  19. #    $Id: ksh.kshrc,v 1.2 1992/04/27 07:09:28 sjg Exp $
  20. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  21. #
  22. #    This file is provided in the hope that it will
  23. #    be of use.  There is absolutely NO WARRANTY.
  24. #    Permission to copy, redistribute or otherwise
  25. #    use this file is hereby granted provided that 
  26. #    the above copyright notice and this notice are
  27. #    left intact. 
  28.  
  29. case "$-" in
  30. *i*)    # we are interactive
  31.     # we may have su'ed so reset these
  32.     # NOTE: SCO-UNIX doesn't have whoami,
  33.     #    install whoami.sh
  34.     USER=`whoami`
  35.     PROMPT="<$USER@$HOSTNAME:!>$ "
  36.     PPROMPT='<$USER@$HOSTNAME:$PWD:!>$ '
  37.     PS1=$PPROMPT
  38.     # $TTY is the tty we logged in on,
  39.     # $tty is that which we are in now (might by pty)
  40.     tty=`tty`
  41.     tty=`basename $tty`
  42.  
  43.     set -o ${FCEDIT:-$EDITOR}
  44.  
  45.     # the PD ksh is not 100% compatible
  46.     case "$KSH_VERSION" in
  47.     *PD*)    # PD ksh
  48.             bind ^?=delete-char-backward
  49.             bind ^[^?=delete-word-backward
  50.         ;;
  51.     *)    # real ksh ?
  52.         ;;
  53.     esac
  54.     case "$TERM" in
  55.     sun*)
  56.         if [ "$tty" != console ]; then
  57.             ILS='\033]L'; ILE='\033\\'
  58.             WLS='\033]l'; WLE='\033\\'
  59.         fi
  60.         ;;
  61.     xterm*)
  62.         ILS='\033]1;'; ILE='\007'
  63.         WLS='\033]2;xterm: '; WLE='\007'
  64.         ;;
  65.     *)    ;;
  66.     esac
  67.     # do we want window decorations?
  68.     if [ "$ILS" ]; then
  69.         wftp () { ilabel "ftp $*"; "ftp" $*; ilabel "$USER@$HOSTNAME"; }
  70.         wcd () { "cd" $*; eval stripe; }
  71.         ilabel () { print -n "${ILS}$*${ILE}"; }
  72.         label () { print -n "${WLS}$*${WLE}"; }
  73.         alias stripe='label $USER @ $HOSTNAME \($tty\) - $PWD'
  74.         alias cd=wcd
  75.         alias ftp=wftp
  76.         eval stripe
  77.         eval ilabel "$USER@$HOSTNAME"
  78.         PS1=$PROMPT
  79.     fi
  80.     alias ls='ls -aCF'
  81.     alias h='fc -l | more'
  82.     alias quit=exit
  83.     alias cls=clear
  84.     alias logout=exit
  85.     alias bye=exit
  86.  
  87.  
  88. # add your favourite aliases here
  89. ;;
  90. *)    # non-interactive
  91. ;;
  92. esac
  93. # commands for both interactive and non-interactive shells
  94.